<html>
<script>
var origin = "http://localhost:8080/proxy/https/QXL-cust233.dev.sapbydesign.com/sap/public/ap/ui/appcfg?v=1702.0.0";

if( origin.search("http://localhost:8080/proxy/") == 0){
	const regex = /^(http:\/\/localhost:8080\/proxy\/)(https)\/(.*)$/;
	var result = regex.exec(origin);
	var final = result[2] + "://" + result[3];
	debugger;
	// var result = regex.
}
console.log(final);
</script>
</html>